import { Application } from 'egg';

export default (app: Application) => {
  const { controller, router } = app;

  // common router
  router.get('/', controller.home.index);

  // 后台用户
  router.get('/api/admin/user/login', controller.adminUser.login);
  router.get('/api/admin/user/current', controller.adminUser.currentUser);
  router.get('/api/admin/user/list', controller.adminUser.list);
  router.post('/api/admin/user/add', controller.adminUser.add);
  router.put('/api/admin/user/update', controller.adminUser.update);
  router.delete('/api/admin/user/delete', controller.adminUser.delete);
};
